package com.ctsi.ssdc.common;

import lombok.Data;

@Data
public class CallBackResult {

    private boolean result;
    private Exception exception;

    public boolean isOk() {
        return result;
    }

    public static CallBackResult fail(Exception exception) {
        CallBackResult callBackResult = new CallBackResult();
        callBackResult.result = false;
        callBackResult.exception = exception;
        return callBackResult;
    }

    public static CallBackResult ok() {
        CallBackResult callBackResult = new CallBackResult();
        callBackResult.result = true;
        return callBackResult;
    }
}
